﻿function jsonToObject(json) {
    return eval("(" + json + ")");
}
//<a href="javascript:check('ids',2);">反选</a>
//<a href="javascript:check('ids',0);">全部选择</a>|
//<a href="javascript:check('ids',1);">清除选择</a>|
/***checkbox多选.***/
function check(name, k) {
    var el = document.getElementsByTagName('input');
    var len = el.length;
    for (var i = 0; i < len; i++) {
        if ((el[i].type == "checkbox") && (el[i].name == name)) {
            if (k == 0) {
                el[i].checked = true;
            }
            if (k == 1) {
                el[i].checked = false;
            }
            if (k == 2) {
                el[i].checked = !el[i].checked;
            }
        }
    }
}
